// component/notice/index.js
const app = getApp()
Component({
    /**
     * 组件的属性列表
     */
    properties: {

    },

    /**
     * 组件的初始数据
     */
    data: {
        show: false,
        content: '',
    },

    /**
     * 组件的方法列表
     */
    methods: {
        hide_notice() {
            this.setData({
                show: false,
            });
            app.globalData.isShow =true
            this.triggerEvent('close', false)
        }
    },
    attached() {
        let that = this;
        if(!app.globalData.isShow){
            app.http.post(app.api.notice, {}, (res) => {
                if (res.data.title != "") {
                    that.setData({
                        notice_title: res.data.title,
                        content: res.data.content,
                        show: true
                    })
                }
            })
        }
 

    }
})